<?php
	session_start();
	$button=$_POST['button'];
	
	
	
	if($button)
	{
		$username=$_POST['username'];
		$password=$_POST['password'];
		$retypepassword=$_POST['retypepassword'];
		$fullname=$_POST['fullname'];
		$email=$_POST['email'];
		$phonenumber=$_POST['phonenumber'];
		if ($username){
			if($password==$retypepassword){
				include("connect.php");
				$query=mysql_query("SELECT * FROM users WHERE username='$username'");
				$numrows=mysql_num_rows($query);
				if($numrows == 0){
					//$password=md5($password);
					echo $password;
					$q=mysql_query("INSERT INTO `users` (`username`,`password`,`fullname`,`email`,`phonenumber`)
					VALUES('$username','$password','$fullname','$email','$phonenumber')");
					echo "you have registered";
					$temp="You have registered successfully!";
					
				}
				else{
					echo "the username is taken";
					$temp="the username is taken";
				}
				}
			else
				echo "password repetitive";
				$temp="password repetitive";
			
			}
			echo "<meta http-equiv=\"refresh\" content=\"1;url=http://localhost/my_project/Software_Engineering%20Project/main/wellness/Login/login_admin.php\">";
		
	}
	

?>